﻿using Liang.DataBase.Model;
using Liang.Model;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace Liang.DataBase.IBLL
{
    /// <summary>
    /// 业务逻辑层基类接口
    /// </summary>
    /// <typeparam name="T">实体对象类型</typeparam>
    public interface IBaseBLL<T> where T : class
    {
        bool Insert(T t);
        bool Delete(object id);
        bool Delete(T t);
        bool Update(T t, object key);
        T FindByID(object id);
        T FindSingle(Expression<Func<T, bool>> match);
        IList<T> FindAll();
        IList<T> FindAll(Expression<Func<T, bool>> match);
        IList<T> FindWithOrderby(Expression<Func<T, bool>> match, string propertyName, bool isDesc = true);
        IList<T> FindWithPagerAndOrderby(Expression<Func<T, bool>> match, ref PageInfo info, string propertyName, bool isDesc = true);
    }
}
